package com.zeta.api.client.auth;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 鉴权服务 Feign接口
 *
 * @author gcc
 */
@FeignClient(name = "auth-server", path = "auth", fallbackFactory = IAuthApiFallbackFactory.class)
public interface IAuthApi {

    /**
     * 返回指定账号id所拥有的权限码集合
     *
     * @param loginId   账号id
     * @param loginType 账号类型
     * @return 该账号id具有的权限码集合
     */
    @GetMapping("/userInfo/permissions")
    List<String> permissions(@RequestParam Object loginId, @RequestParam(required = false) String loginType);

    /**
     * 返回指定账号id所拥有的角色标识集合
     *
     * @param loginId   账号id
     * @param loginType 账号类型
     * @return 该账号id具有的角色标识集合
     */
    @GetMapping("/userInfo/roles")
    List<String> roles(@RequestParam Object loginId, @RequestParam(required = false) String loginType);
}
